home *** CD-ROM | disk | FTP | other *** search
/ Linux Cubed Series 7: Sunsite / Linux Cubed Series 7 - Sunsite Vol 1.iso / system / network / file-tra / ftp-rl.taz / ftp-rl / ftp / ftp_var.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-10-07  |  4.7 KB  |  128 lines

  1. /*
  2.  * Copyright (c) 1985, 1989 Regents of the University of California.
  3.  * All rights reserved.
  4.  *
  5.  * Redistribution and use in source and binary forms are permitted
  6.  * provided that: (1) source distributions retain this entire copyright
  7.  * notice and comment, and (2) distributions including binaries display
  8.  * the following acknowledgement:  ``This product includes software
  9.  * developed by the University of California, Berkeley and its contributors''
  10.  * in the documentation or other materials provided with the distribution
  11.  * and in all advertising materials mentioning features or use of this
  12.  * software. Neither the name of the University nor the names of its
  13.  * contributors may be used to endorse or promote products derived
  14.  * from this software without specific prior written permission.
  15.  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
  16.  * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  17.  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  18.  *
  19.  *    @(#)ftp_var.h    5.9 (Berkeley) 6/1/90
  20.  */
  21.  
  22. /*
  23.  * Include some definitions to massage the differences betweem 4.3-reno
  24.  * and Umax.
  25.  */
  26. #include "compat.h"
  27.  
  28. /*
  29.  * FTP global variables.
  30.  */
  31.  
  32. /*
  33.  * Options and other state info.
  34.  */
  35. int    trace;            /* trace packets exchanged */
  36. int    hash;            /* print # for each buffer transferred */
  37. int    sendport;        /* use PORT cmd for each data connection */
  38. int    verbose;        /* print messages coming back from server */
  39. int    connected;        /* connected to server */
  40. int    fromatty;        /* input is from a terminal */
  41. int    interactive;        /* interactively prompt on m* cmds */
  42. int    debug;            /* debugging level */
  43. int    bell;            /* ring bell on cmd completion */
  44. int    doglob;            /* glob local file names */
  45. int    autologin;        /* establish user account on connection */
  46. int    proxy;            /* proxy server connection active */
  47. int    proxflag;        /* proxy connection exists */
  48. int    sunique;        /* store files on server with unique name */
  49. int    runique;        /* store local files with unique name */
  50. int    mcase;            /* map upper to lower case for mget names */
  51. int    ntflag;            /* use ntin ntout tables for name translation */
  52. int    mapflag;        /* use mapin mapout templates on file names */
  53. int    code;            /* return/reply code for ftp command */
  54. int    crflag;            /* if 1, strip car. rets. on ascii gets */
  55. char    pasv[64];        /* passive port for proxy data connection */
  56. char    *altarg;        /* argv[1] with no shell-like preprocessing  */
  57. char    ntin[17];        /* input translation table */
  58. char    ntout[17];        /* output translation table */
  59. #include <sys/param.h>
  60. char    mapin[MAXPATHLEN];    /* input map template */
  61. char    mapout[MAXPATHLEN];    /* output map template */
  62. char    typename[32];        /* name of file transfer type */
  63. int    type;            /* requested file transfer type */
  64. int    curtype;        /* current file transfer type */
  65. char    structname[32];        /* name of file transfer structure */
  66. int    stru;            /* file transfer structure */
  67. char    formname[32];        /* name of file transfer format */
  68. int    form;            /* file transfer format */
  69. char    modename[32];        /* name of file transfer mode */
  70. int    mode;            /* file transfer mode */
  71. char    bytename[32];        /* local byte size in ascii */
  72. int    bytesize;        /* local byte size in binary */
  73.  
  74. char    *hostname;        /* name of host connected to */
  75. int    unix_server;        /* server is unix, can use binary for ascii */
  76. int    unix_proxy;        /* proxy is unix, can use binary for ascii */
  77.  
  78. struct    servent *sp;        /* service spec for tcp/ftp */
  79.  
  80. #include <setjmp.h>
  81. jmp_buf    toplevel;        /* non-local goto stuff for cmd scanner */
  82.  
  83. char    line[200];        /* input line buffer */
  84. char    *stringbase;        /* current scan point in line buffer */
  85. char    argbuf[200];        /* argument storage buffer */
  86. char    *argbase;        /* current storage point in arg buffer */
  87. int    margc;            /* count of arguments on input line */
  88. char    *margv[20];        /* args parsed from input line */
  89. int     cpend;                  /* flag: if != 0, then pending server reply */
  90. int    mflag;            /* flag: if != 0, then active multi command */
  91.  
  92. int    options;        /* used during socket creation */
  93.  
  94. /*
  95.  * Format of command table.
  96.  */
  97. struct cmd {
  98.     char    *c_name;    /* name of command */
  99.     char    *c_help;    /* help string */
  100.     char    c_bell;        /* give bell when command completes */
  101.     char    c_conn;        /* must be connected to use command */
  102.     char    c_proxy;    /* proxy server may execute */
  103.     int    (*c_handler)();    /* function to call */
  104. };
  105.  
  106. struct macel {
  107.     char mac_name[9];    /* macro name */
  108.     char *mac_start;    /* start of macro in macbuf */
  109.     char *mac_end;        /* end of macro in macbuf */
  110. };
  111.  
  112. int macnum;            /* number of defined macros */
  113. struct macel macros[16];
  114. char macbuf[4096];
  115.  
  116. extern    char *tail();
  117. extern    char *index();
  118. extern    char *rindex();
  119. extern    char *remglob();
  120. extern    int errno;
  121. extern    char *mktemp();
  122. extern    char *strncpy();
  123. extern    char *strncat();
  124. extern    char *strcat();
  125. extern    char *strcpy();
  126.  
  127. typedef __sighandler_t    sig_t;
  128.